//
//  PullUpDeviceTableViewCell.m
//  EZ Tracker
//
//  Created by FENGYL on 2017/3/14.
//  Copyright © 2017年 FENGYL. All rights reserved.
//

#import "PullUpDeviceTableViewCell.h"
#import "UIView+XL.h"

@interface PullUpDeviceTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *deviceIcon;
@property (weak, nonatomic) IBOutlet UILabel *serialNumberLabel;
@property (weak, nonatomic) IBOutlet UILabel *deviceNameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *selectImageView;

@end

@implementation PullUpDeviceTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self = [[NSBundle mainBundle] loadNibNamed:@"PullUpDeviceTableViewCell" owner:nil options:nil].lastObject;
        
        
    }
    return self;
}

-(void)setUpCellForDeviceIcon:(UIImage *)deviceIcon serialNumber:(NSString *)serialNumber deviceName:(NSString *)deviceName isSelect:(BOOL)isSelected{
    
    self.deviceIcon.image = deviceIcon;
    
    [self.serialNumberLabel setText:serialNumber];
    
    [self.deviceNameLabel setText:deviceName];
    
    self.selectImageView.hidden = isSelected;
    
}

-(NSString *)getSerialNumberString{
    
    return self.serialNumberLabel.text;
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
